import axios from 'axios'

function get (url:string, params?:any) {
  return new Promise((resolve, reject) => {
    axios.get(url, {
      params: params
    }).then(response => {
      resolve(response.data)
    }).catch(error => {
      reject(error)
      console.log(error)
    })
  })
}

export const getNews = async () => {
  return get('http://excerpt.rubaoo.com/toolman/getMiniNews')
}